import request from '@/utils/request'

// 查询城市天气列表
export function listWeather(query) {
  return request({
    url: '/business/weather/list',
    method: 'get',
    params: query
  })
}

// 查询城市天气列表
export function todayWeather(query) {
  return request({
    url: '/business/weather/today',
    method: 'get',
    params: query
  })
}

// 查询城市天气详细
export function getWeather(id) {
  return request({
    url: '/business/weather/' + id,
    method: 'get'
  })
}

// 新增城市天气
export function addWeather(data) {
  return request({
    url: '/business/weather',
    method: 'post',
    data: data
  })
}

// 修改城市天气
export function updateWeather(data) {
  return request({
    url: '/business/weather',
    method: 'put',
    data: data
  })
}

// 删除城市天气
export function delWeather(id) {
  return request({
    url: '/business/weather/' + id,
    method: 'delete'
  })
}

// 查询所有城市天气
export function getAllWeather(id) {
  return request({
    url: '/business/weather/all',
    method: 'get'
  })
}

// 查询折线图数据
export function getLineData(query) {
  return request({
    url: '/business/SevenWeatherData/echars',
    method: 'get'
  })
}

// 查询柱状图数据
export function getTotal(query) {
  return request({
    url: '/business/weather/total',
    method: 'get'
  })
}

// 查询农作物数据
export function getCropData(query) {
  return request({
    url: '/business/crops/all',
    method: 'get'
  })
}
